<?php

class Button extends Element
{
	var $button = "<input type=\"{type}\" name=\"{name}\" value=\"{value}\"{params} />";
	var $value;

	function Button($id)
	{
		parent::Element($id);
		$this->label = '&nbsp;';
	}

	function getType()
	{
		return empty($this->type) ? 'submit' : $this->type;
	}

	function __getColspan()
	{
		if ($this->__maxCols != 0)
		{
			return " colspan=\"".$this->__maxCols."\"";
		}
		return "";
	}

	function __getHTML()
	{
		return str_replace(array('{type}', '{name}', '{value}', '{params}'), array($this->getType(), $this->name, $this->value, $this->getParams()), $this->button);
	}
}

?>